<?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:63:"D:\phpStudy\WWW\red\public/../application/admin\view\index.html";i:1539237254;s:61:"D:\phpStudy\WWW\red\application\admin\view\public\header.html";i:1534486842;s:61:"D:\phpStudy\WWW\red\application\admin\view\public\footer.html";i:1534487249;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="Shortcut Icon"type="image/x-icon"href="favicon.ico">
    <title><?php echo config('WEB_SITE_TITLE'); ?></title>
    <link href="/static/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/static/admin/css/font-awesome.min.css?v=4.7.0" rel="stylesheet">
    <link href="/static/admin/css/animate.min.css" rel="stylesheet">
    <link href="/static/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <!--<link href="/static/admin/css/plugins/chosen/chosen.css" rel="stylesheet">-->
    <!--<link href="/static/admin/css/plugins/switchery/switchery.css" rel="stylesheet">-->
    <link href="/static/admin/css/style.min.css?v=4.1.0" rel="stylesheet">
    <link href="/static/admin/css/cropper.min.css" rel="stylesheet">
    <link href="/static/admin/css/ImgCropping.css" rel="stylesheet">
    <link href="/static/admin/css/plugins/switch.css" rel="stylesheet">
    <link href="/static/admin/css/plugins/footable/footable.core.css" rel="stylesheet">
    <link href="/static/admin/js/plugins/layui/css/layui.css" rel="stylesheet">
    <link href="/static/admin/css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" rel="stylesheet">
    <link href="/static/admin/js/plugins/viewer/viewer.css" rel="stylesheet">
    <link href="/static/admin/js/plugins/swiper/css/swiper.min.css" rel="stylesheet">
    <link href="/static/admin/js/webupload/webuploader.css" rel="stylesheet">
    <link href="/static/admin/js/webupload/style.css" rel="stylesheet">
    <link href="/static/admin/js/plugins/zTree/zTreeStyle.css" rel="stylesheet" >
    <link href="/static/admin/js/plugins/formSelects-v4/formSelects-v4.css" rel="stylesheet" >
    <script src="/static/admin/js/Icon.js"></script>
    <style type="text/css">
    .long-tr th{text-align: center;}
    .long-td td{text-align: center;}
    input{outline:none;}
    .bt{outline:none;}
    body{overflow-y: scroll;}
    .closeP{width:60px;height:60px;text-align: center;line-height: 70px;border-radius:30px;background:rgba(0,0,0,0.5);font-size: 25px;position: fixed;top:-23px;right:-15px;color: #ccc;cursor: pointer;}
    .cha{position:relative;top:1px;right:8px;}
    .closeP:hover{color: white}
    .showP{width: 100%;height: 100vh;overflow: auto;background: rgba(0,0,0,0.5);text-align: center;position: fixed;top: 0;left: 0;z-index: 1000;}
    #chooseicon {margin:20px;}
    #chooseicon ul { margin:5px 0 0 0;}
    #chooseicon ul li{width:41px;height:41px;line-height:41px;border:1px solid #e7e7e7;padding:1px;margin:1px;text-align: center;font-size:18px;}
    #chooseicon ul li:hover{border:1px solid #2c3e50;cursor:pointer;}
    </style>
</head>
<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden" >
<input type="hidden" id="theme" value="<?php echo $theme; ?>">
<div id="wrapper" >
    <!--左侧导航开始-->
    <nav class="navbar-default navbar-static-side" role="navigation">
        <div class="nav-close"><i class="fa fa-times-circle"></i>
        </div>
        <div class="sidebar-collapse">
            <ul class="nav" id="side-menu">
                <li class="nav-header">
                    <div class="dropdown profile-element" style="text-align:center">
                        <span>
                            <ul id="view" >
                                <li><img data-original="<?php echo $portrait; ?>" src="<?php echo $portrait; ?>" class="img-circle"  style="width:70px;height:70px;cursor:pointer;" onerror="this.src='/static/admin/images/head_default.gif'" /></li>
                            </ul>
                        </span>
                        <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                            <span class="clear">
                                <span class="block m-t-xs"><strong class="font-bold"><?php echo $username; ?></strong></span>
                                <span class="text-muted text-xs block"><?php echo $rolename; ?><b class="caret"></b></span>
                            </span>
                        </a>
                        <ul class="dropdown-menu animated fadeInRight m-t-xs">
                            <li><a href="javascript:;" onclick="wk.layer_show1('修改头像',$('#headCrop'),700,550)" ><i class="fa fa-crop"></i> 修改头像</a></li>
                            <li><a href="javascript:;" onclick="wk.layer_show1('修改密码',$('#changePwd'),500,380)"><i class="fa fa-unlock-alt"></i> 修改密码</a></li>
                            <li><a href="javascript:;" id="cache"><i class="fa fa-hourglass-half"></i> 清除缓存</a></li>
                            <li class="divider"></li>
                            <li><a href="<?php echo url('admin/login/loginOut'); ?>"><i class="fa fa-sign-out"></i> 安全退出</a></li>
                        </ul>
                    </div>
                    <div class="logo-element">H+</div>
                </li>
                <?php if(!empty($menu)): if(is_array($menu) || $menu instanceof \think\Collection || $menu instanceof \think\Paginator): if( count($menu)==0 ) : echo "" ;else: foreach($menu as $key=>$vo): ?>
                        <li class="menu">
                            <?php if($vo['name'] == '#'): ?>
                                <a href="<?php echo $vo['href']; ?>">
                                    <i class="<?php echo $vo['css']; ?>"></i>
                                    <span class="nav-label"><?php echo $vo['title']; ?> </span>
                                    <span class="fa arrow"></span>
                                </a>
                            <?php else: ?>
                                <a class="J_menuItem" href="<?php echo $vo['href']; ?>">
                                    <i class="<?php echo $vo['css']; ?>"></i>
                                    <span class="nav-label"><?php echo $vo['title']; ?> </span>
                                </a>
                            <?php endif; if($vo['name'] == '#'): ?>
                            <ul class="nav nav-second-level">
                                <?php if(!empty($vo['child'])): if(is_array($vo['child']) || $vo['child'] instanceof \think\Collection || $vo['child'] instanceof \think\Paginator): if( count($vo['child'])==0 ) : echo "" ;else: foreach($vo['child'] as $key=>$v): if($v['name'] != '##'): ?>
                                            <li>
                                                <a class="J_menuItem" href="<?php echo $v['href']; ?>"><?php echo $v['title']; ?></a>
                                            </li>
                                        <?php else: ?>
                                            <li>
                                                <a href="<?php echo $v['href']; ?>"><?php echo $v['title']; ?><span class="fa arrow"></span></a>
                                                <ul class="nav nav-third-level">
                                                    <?php if(!empty($v['child'])): if(is_array($v['child']) || $v['child'] instanceof \think\Collection || $v['child'] instanceof \think\Paginator): if( count($v['child'])==0 ) : echo "" ;else: foreach($v['child'] as $key=>$z): ?>
                                                        <li><a class="J_menuItem" href="<?php echo $z['href']; ?>"><?php echo $z['title']; ?></a>
                                                        </li>
                                                        <?php endforeach; endif; else: echo "" ;endif; endif; ?>
                                                </ul>
                                            </li>
                                        <?php endif; endforeach; endif; else: echo "" ;endif; endif; ?>
                            </ul>
                            <?php endif; ?>
                        </li>
                    <?php endforeach; endif; else: echo "" ;endif; endif; ?>
            </ul>
        </div>
    </nav>
    <!--左侧导航结束-->
    <!--右侧部分开始-->
    <div id="page-wrapper" class="gray-bg dashbard-1">
        <div class="row border-bottom">
            <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
                <div class="navbar-header"><a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#"><i
                        class="fa fa-bars"></i> </a>
                </div>
                <ul class="nav navbar-top-links navbar-right">
                    <!--<li class="dropdown hidden-xs">-->
                        <!--<a href="javascript:;" data-toggle="modal" data-target="#myTags" aria-expanded="false">-->
                            <!--<i class="fa fa-tags"></i> 标签-->
                        <!--</a>-->
                    <!--</li>-->
                    <!--<li class="dropdown hidden-xs">-->
                        <!--<a class="right-sidebar-toggle" aria-expanded="false">-->
                            <!--<i class="fa fa-tasks"></i> 主题-->
                        <!--</a>-->
                    <!--</li>-->

                </ul>
            </nav>
        </div>
        <div class="row content-tabs">
            <button class="roll-nav roll-left J_tabLeft"><i class="fa fa-backward"></i>
            </button>
            <nav class="page-tabs J_menuTabs">
                <div class="page-tabs-content">
                    <a href="javascript:;" class="active J_menuTab" data-id="index.html">首页</a>
                </div>
            </nav>
            <button class="roll-nav roll-right J_tabRight"><i class="fa fa-forward"></i>
            </button>
            <div class="btn-group roll-nav roll-right">
                <button class="dropdown J_tabClose" data-toggle="dropdown">常用操作<span class="caret"></span></button>
                <ul role="menu" class="dropdown-menu dropdown-menu-right animated fadeInRight">
                    <li class="J_tabFresh"><a><i class="fa fa-repeat"></i> 刷 新</a></li>
                    <li class="divider"></li>
                    <li class="J_tabGo"><a><i class="fa fa-mail-forward"></i> 前 进</a></li>
                    <li class="J_tabBack"><a><i class="fa fa-mail-reply"></i> 后 退</a></li>
                    <li class="divider"></li>
                    <li class="J_tabShowActive"><a><i class="fa fa-crosshairs"></i> 定位当前选项卡</a></li>
                    <li class="divider"></li>
                    <li class="J_tabCloseOther"><a><i class="fa fa-times-circle-o"></i> 关闭其他选项卡</a></li>
                    <li class="J_tabCloseAll"><a><i class="fa fa-times-circle"></i> 关闭全部选项卡</a></li>
                </ul>
            </div>
            <a href="javascript:;" id="logout" class="roll-nav roll-right J_tabExit">
                <i class="fa fa fa-sign-out"></i>退出
            </a>
        </div>
        <div class="row J_mainContent" id="content-main">
            <iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="<?php echo url('Index/indexPage'); ?>" frameborder="0" data-id="index.html" seamless></iframe>
        </div>
        <div class="footer">
            <div class="pull-right">&copy; 2017-2018 <?php echo config('web_site_title'); ?> 版权所有
            </div>
        </div>
    </div>
    <!--右侧部分结束-->
    <!--右侧边栏开始-->
    <div id="right-sidebar">
        <div class="sidebar-container">
            <ul class="nav nav-tabs navs-9">
                <li class="active">
                    <a data-toggle="tab" href="#tab-1">
                        <i class="fa fa-gear"></i> 主题
                    </a>
                </li>

            </ul>
            <div class="tab-content">
                <div id="tab-1" class="tab-pane active">
                    <div class="sidebar-title">
                        <h3> <i class="fa fa-comments-o"></i> 主题设置</h3>
                        <small><i class="fa fa-tim"></i> 你可以从这里选择和预览主题的布局和样式，这些设置会被保存在本地，下次打开的时候会直接应用这些设置。</small>
                    </div>
                    <div class="skin-setttings">
                        <div class="title">主题设置</div>
                        <div class="setings-item">
                            <span>收起左侧菜单</span>
                            <div class="switch">
                                <div class="onoffswitch">
                                    <input type="checkbox" name="collapsemenu" class="onoffswitch-checkbox" id="collapsemenu" onclick="coll()">
                                    <label class="onoffswitch-label" for="collapsemenu">
                                        <span class="onoffswitch-inner"></span>
                                        <span class="onoffswitch-switch"></span>
                                    </label>
                                </div>
                            </div>
                        </div>
                        <div class="setings-item">
                            <span>固定顶部</span>
                            <div class="switch">
                                <div class="onoffswitch">
                                    <input type="checkbox" name="fixednavbar" class="onoffswitch-checkbox" id="fixednavbar" onclick="fixed()">
                                    <label class="onoffswitch-label" for="fixednavbar">
                                        <span class="onoffswitch-inner"></span>
                                        <span class="onoffswitch-switch"></span>
                                    </label>
                                </div>
                            </div>
                        </div>
                        <div class="setings-item">
                            <span>固定宽度</span>
                            <div class="switch">
                                <div class="onoffswitch">
                                    <input type="checkbox" name="boxedlayout" class="onoffswitch-checkbox" id="boxedlayout" onclick="boxed()">
                                    <label class="onoffswitch-label" for="boxedlayout">
                                        <span class="onoffswitch-inner"></span>
                                        <span class="onoffswitch-switch"></span>
                                    </label>
                                </div>
                            </div>
                        </div>
                        <div class="title">皮肤选择</div>
                        <div class="setings-item default-skin nb">
                            <span class="skin-name ">
                                 <a href="#" class="s-skin-0" onclick="changeTheme('1')" >
                                     默认皮肤
                                 </a>
                            </span>
                        </div>
                        <div class="setings-item blue-skin nb">
                            <span class="skin-name " >
                                <a href="#" class="s-skin-1" onclick="changeTheme('2')" >
                                    蓝色主题
                                </a>
                            </span>
                        </div>
                        <div class="setings-item yellow-skin nb">
                            <span class="skin-name ">
                                <a href="#" class="s-skin-3" onclick="changeTheme('3')" >
                                    黄色主题
                                </a>
                            </span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--mini聊天窗口开始-->
        <!--<div class="small-chat-box fadeInUpBig animated ">-->
            <!--<div class="heading" draggable="true">-->
                <!--<small class="chat-date pull-right">-->
                    <!--2015.9.1-->
                <!--</small> 代办事项-->
            <!--</div>-->
        <!--</div>-->
        <!--<div id="small-chat" class="animated bounceInUp">-->
            <!--<span class="badge badge-warning pull-right">0</span>-->
            <!--<a class="open-small-chat">-->
                <!--<i class="fa fa-comments"></i>-->
            <!--</a>-->
        <!--</div>-->
    </div>
    <!--右侧边栏结束-->
</div>
<script src="/static/admin/js/jquery.min.js?v=2.1.4"></script>
<script src="/static/admin/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/static/admin/js/content.min.js?v=1.0.0"></script>
<!--<script src="/static/admin/js/plugins/chosen/chosen.jquery.js"></script>-->
<script src="/static/admin/js/plugins/iCheck/icheck.min.js"></script>
<script src="/static/admin/js/plugins/layer/laydate/laydate.js"></script>
<!--<script src="/static/admin/js/plugins/switchery/switchery.js"></script>&lt;!&ndash;IOS开关样式&ndash;&gt;-->
<script src="/static/admin/js/jquery.form.js"></script>
<script src="/static/admin/js/plugins/layer/layer.js"></script>
<script src="/static/admin/js/plugins/layui/layui.js"></script>
<script src="/static/admin/js/wk.js"></script>
<script src="/static/admin/js/state.js"></script>
<!--<script src="/static/admin/js/plugins/validate/jquery.validate.min.js"></script>-->
<!--<script src="/static/admin/js/plugins/validate/messages_zh.min.js"></script>-->
<script src="/static/admin/js/cropper.min.js"></script>
<script src="/static/admin/js/plugins/footable/footable.all.min.js"></script>
<script src="/static/admin/js/plugins/viewer/viewer.js"></script>
<!--<script src="/static/admin/js/plugins/excel-gen/jszip.js"></script>-->
<!--<script src="/static/admin/js/plugins/excel-gen/FileSaver.js"></script>-->
<!--<script src="/static/admin/js/plugins/excel-gen/excel-gen.js"></script>-->
<script src="/static/admin/js/plugins/swiper/js/swiper.min.js"></script>
<script src="/static/admin/js/common.js"></script>
<script src="/static/admin/js/webupload/webuploader.js"></script>
<script src="/static/admin/js/plugins/ueditor/ueditor.config.js" ></script>
<script src="/static/admin/js/plugins/ueditor/ueditor.all.js" ></script>
<script src="/static/admin/js/plugins/zTree/jquery.ztree.core-3.5.js"></script>
<script src="/static/admin/js/plugins/zTree/jquery.ztree.excheck-3.5.js"></script>
<script src="/static/admin/js/plugins/zTree/jquery.ztree.exedit-3.5.js"></script>
<script src="/static/admin/js/plugins/formSelects-v4/formSelects-v4.js"></script>
<script>
    $(document).ready(function(){$(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",})});
    //tooltip提示
    $("[data-toggle='tooltip']").tooltip();
    //图片灯箱
    function imgDisplay(obj) {
        var src = $(obj).attr("src");
        var imgHtml = '<div class="showP"><img src=' + src + ' style="margin-top: 30px;height:90%;margin-bottom: 50px;"  /><p class="closeP"  onclick="closePicture(this)"><span class="cha">×</span></p></div>'
        $('body').append(imgHtml);
    }

    //关闭图片灯箱
    function closePicture(obj) {
        $(obj).parent("div").remove();
    }
    //关闭自动填充
    $('input').attr('autocomplete',"off");

    //layuitable表格重载
    function tableReload(){
        layui.use('table', function () {
            var table = layui.table;
            table.reload('testReload', {
                page: {
                    curr: 1 //重新从第 1 页开始
                }
                , where: {}
            });
        });
    }

    // //IOS开关样式配置 & chosen-select初始化
    // var elem = document.querySelector('.js-switch');
    // var switchery = new Switchery(elem, {
    //     color: '#1AB394'
    // });
    // var config = {
    //     '.chosen-select': {},
    // }
    // for (var selector in config) {
    //     $(selector).chosen(config[selector]);
    // }

    //view初始化查看图片
    function view(obj){
        $(obj).viewer({
            url: 'data-original',
        });
    }
</script>

<script>
    //chose地区三级联动
    function area(obj,type){
        if($(obj).val() == ''){
            if(type == 'province'){
                $("#city").empty();
                $("#city").append('<option value="">---- 所在市 ----</option>');
                $("#city").trigger("chosen:updated");
                $("#district").empty();
                $("#district").append('<option value="">---- 所在区 ----</option>');
                $("#district").trigger("chosen:updated");
            }else if(type == 'city'){
                $("#district").empty();
                $("#district").append('<option value="">---- 所在区 ----</option>');
                $("#district").trigger("chosen:updated");
            }
            return false;
        }
        $.ajax({
            url:"<?php echo url('admin/Base/place'); ?>",
            dataType:"json",
            data:'id='+$(obj).val(),
            type:'post',
            success:function(res){
                var opt = null;
                $.each(res.msg,function(key,vo){
                    opt = opt+"<option value="+vo.district_id+">"+vo.district+"</option>";
                })
                if(type == 'province'){
                    $("#city").empty();
                    $("#city").append('<option value="">---- 所在市 ----</option>');
                    $("#city").append(opt);
                    $("#city").trigger("chosen:updated");
                    $("#district").empty();
                    $("#district").append('<option value="">---- 所在区 ----</option>');
                    $("#district").trigger("chosen:updated");
                }else if(type == 'city'){
                    $("#district").empty();
                    $("#district").append('<option value="">---- 所在区 ----</option>');
                    $("#district").append(opt);
                    $("#district").trigger("chosen:updated");
                }
            }
        })
    }
    //layui三级联动
    layui.use(['form'], function() {
        var form = layui.form
            , layer = layui.layer
        form.on('select(province)', function(data){
            getArea("province",data.value);
        });
        form.on('select(city)', function(data){
            getArea("city",data.value);
        });
        function getArea(type,id){
            $.ajax({
                url:"<?php echo url('admin/Base/place'); ?>",
                dataType:"json",
                data:'id='+id,
                type:'post',
                success:function(res){
                    var opt = '';
                    $.each(res.msg,function(key,vo){
                        opt = opt+"<option value="+vo.district_id+">"+vo.district+"</option>";
                    })
                    if(type=="province"){
                        $("#city").empty();
                        $("#city").append('<option value="">---- 请选择市 ----</option>');
                        $("#district").empty();
                        $("#district").append('<option value="">---- 请选择区 ----</option>');
                        form.render('select','district');
                        $("#city").append(opt);
                        form.render('select','city');
                    }else if(type == "city"){
                        $("#district").empty();
                        $("#district").append('<option value="">---- 请选择区 ----</option>');
                        $("#district").append(opt);
                        form.render('select','district');
                    }
                }
            })
        }
    })
</script>
<script>
    // //tips框
    // $('#offAll').on('mouseover', function(){
    //     var that = this;
    //     layer.tips('<span style="color:#686B6D;"><i class="fa fa-info-circle"></i> 若未勾选默认禁用全部</span>', that,{tips: [2, '#F2F2F2'],time: 10000});
    // });
    // //tips框
    // $('#onAll').on('mouseover', function(){
    //     var that = this;
    //     layer.tips('<span style="color:#686B6D;"><i class="fa fa-info-circle"></i> 若未勾选默认启用全部</span>', that,{tips: [2, '#F2F2F2',''],time: 10000});
    // });
    //tips框
    // $('#excel').on('mouseover', function(){
    //     var that = this;
    //     layer.tips('<span style="color:#686B6D;"><i class="fa fa-info-circle"></i> 导出筛选完成数据</span>', that,{tips: [2, '#F2F2F2',''],time: 10000});
    // });
    // //关闭tips框
    // $('#offAll,#onAll,#export,#excel').on('mouseout', function(){
    //     layer.closeAll('tips');
    // });

    //layui公共操作
    layui.use(['form','table'], function() {
        var form = layui.form
            , layer = layui.layer
            ,table = layui.table
        //重置搜索框
        $('#empty').on('click', function () {
            $('.search').val('');
            // $(".search").trigger("chosen:updated");
            $('select').each(function (i, j) {
                $(j).find("option:selected").attr("selected", false);
                form.render('select')
            })
        });
        //表格排序
        table.on('sort(demo)', function(obj){
            table.reload('testReload', {
                initSort: obj //记录初始排序，如果不设的话，将无法标记表头的排序状态
                ,where: { //请求参数
                    field: obj.field //排序字段
                    ,order: obj.type //排序方式
                }
            });
        });
        //监听搜索
        form.on('submit(LAY-search)', function (data) {
            //执行重载
            table.reload('testReload', {
                page: {
                    curr: 1 //重新从第 1 页开始
                }
                ,where: data.field
            });
        });
    });
    //获取serialize数据转对象
    $.fn.parseForm=function(){
        var serializeObj={};
        var array=this.serializeArray();
        var str=this.serialize();
        $(array).each(function(){
            if(serializeObj[this.name]){
                if($.isArray(serializeObj[this.name])){
                    serializeObj[this.name].push(this.value);
                }else{
                    serializeObj[this.name]=[serializeObj[this.name],this.value];
                }
            }else{
                serializeObj[this.name]=this.value;
            }
        });
        return serializeObj;
    }
</script>

<div id="headCrop" style="display:none">
    <form class="form-horizontal" name="add_rule" id="add_rule">
        <div class="ibox-content">
            <!--图片裁剪框 start-->
            <div class="black-cloth" onclick="closeTailor(this)"></div>
            <div class="tailoring-content">
                <div class="tailoring-content-one">
                    <label title="选择图片" for="chooseImg" class="btn btn-primary btn-outline choose-btn">
                        <input type="file" accept="image/jpg,image/jpeg,image/png" name="file" id="chooseImg" class="hidden" onchange="selectImg(this)"><i class="fa fa-link"></i>
                        选择图片
                    </label>
                </div>
                <div class="tailoring-content-two">
                    <div class="tailoring-box-parcel" style="text-align: center">
                        <img id="tailoringImg">
                        <span class="word" style="position:relative;top:50%;font-size:16px">仅支持JPG、JPEG、PNG格式的图片文件</span><br>
                        <span class="size" style="position:relative;top:50%;font-size:16px">文件不能大于2MB</span>
                    </div>
                    <div class="preview-box-parcel">
                        <p>图片预览：</p>
                        <div class="square previewImg"></div>
                        <div class="circular previewImg"></div>
                    </div>
                </div>
            </div>
        </div>
        <!--图片裁剪框 end-->
        <div class="modal-footer">
            <span class="btn btn-primary btn-outline cropper-reset-btn" style="float:left">复位</span>
            <span class="btn btn-primary btn-outline zoomIn" style="float:left">放大</span>
            <span class="btn btn-primary btn-outline zoomOut" style="float:left">缩小</span>
            <span class="btn btn-primary btn-outline cropper-rotate-btn" style="float:left">旋转</span>
            <span  class="btn btn-primary btn-outline cropper-scaleX-btn" style="float:left">换向</span>
            <span class="btn btn-primary" id="sureCut"><i class="fa fa-save"></i> 保存</span>
            <button type="button" class="btn btn-danger" onclick="layer.closeAll()"><i class="fa fa-close"></i> 关闭</button>
        </div>
    </form>
</div>
<!--标签-->
<!--<div class="modal  fade" id="myTags" tabindex="-1" role="dialog"  aria-hidden="true">-->
    <!--<div class="modal-dialog">-->
        <!--<div class="modal-content">-->
            <!--<div class="modal-header">-->
                <!--<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>-->
                <!--<h3 class="modal-title">添加标签</h3>-->
            <!--</div>-->
            <!--<form class="form-horizontal"  id="add_tags">-->
                <!--<div class="ibox-content">-->
                    <!--<div class="form-group">-->
                        <!--<label class="col-sm-3 control-label">标题</label>-->
                        <!--<div class="col-sm-8">-->
                            <!--<input type="text" name="tag_title" id="tag_title" placeholder="输入标签标题" class="form-control" autocomplete="off"/>-->
                        <!--</div>-->
                    <!--</div>-->
                    <!--<div class="hr-line-dashed"></div>-->
                    <!--<div class="form-group">-->
                        <!--<label class="col-sm-3 control-label">日期</label>-->
                        <!--<div class="col-sm-8">-->
                            <!--<input type="text"  name="tag_time" onclick="laydate({istime: true,format: 'YYYY-MM-DD hh:mm'})" id="start_date" class="form-control layer-date" placeholder="输入日期" autocomplete="off"/>-->
                            <!--<span class="help-block m-b-none" ><i class="fa fa-info-circle"></i> 必填</span>-->
                        <!--</div>-->
                    <!--</div>-->
                    <!--<div class="hr-line-dashed"></div>-->
                    <!--<div class="form-group">-->
                        <!--<label class="col-sm-3 control-label">内容</label>-->
                        <!--<div class="col-sm-8">-->
                            <!--<textarea type="text" rows="5" name="tag_content" id="tag_content" placeholder="输入标签内容" class="form-control"></textarea>-->
                            <!--<span class="help-block m-b-none" ><i class="fa fa-info-circle"></i> 必填</span>-->
                        <!--</div>-->
                    <!--</div>-->
                <!--</div>-->
                <!--<div class="modal-footer">-->
                    <!--<button type="submit" class="btn btn-primary"><i class="fa fa-save"></i> 保存</button>-->
                    <!--<button type="button" class="btn btn-danger" data-dismiss="modal"><i class="fa fa-close"></i> 关闭</button>-->
                <!--</div>-->
            <!--</form>-->
        <!--</div>-->
    <!--</div>-->
<!--</div>-->

<!--修改密码-->
<div id="changePwd" style="display:none;">
    <div class="layui-fluid layui-col-xs12">
        <div class="layui-card-body layui-form">
            <div class="layui-row layui-col-space20 layui-form-item ">
                <div class="layui-form-item layui-col-xs10">
                    <label class="layui-form-label">原密码：</label>
                    <div class="layui-input-block">
                        <input type="password" name="old_pwd"  placeholder="输入原密码" lay-verify="required|oldpwd" class="layui-input" autocomplete="off"/>
                    </div>
                </div>
                <div class="layui-form-item layui-col-xs10">
                    <label class="layui-form-label">新密码：</label>
                    <div class="layui-input-block">
                        <input type="password" name="new_pwd"  placeholder="输入新密码" lay-verify="required|newpwd" class="layui-input" autocomplete="off"/>
                    </div>
                </div>
                <div class="layui-form-item layui-col-xs10">
                    <label class="layui-form-label">确认密码：</label>
                    <div class="layui-input-block">
                        <input type="password" name="r_pwd"  placeholder="输入确认密码" lay-verify="required|rpwd" class="layui-input" autocomplete="off"/>
                    </div>
                </div>
                <div class="layui-form-item layui-col-xs-offset1 layui-col-xs8">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit="" lay-filter="component-form-element">保存
                        </button>
                        <button class="layui-btn layui-btn-primary" onclick="layer.closeAll()">关闭</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="/static/admin/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="/static/admin/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="/static/admin/js/hplus.min.js?v=4.1.0"></script>
<script src="/static/admin/js/contabs.js"></script>
<script src="/static/admin/js/plugins/pace/pace.min.js"></script>
<script src="/static/admin/js/Crop.js"></script>
<script type="text/javascript">
    //view查看图片
    $('#view').viewer({
        url: 'data-original',
    });
    $(function(){
        var theme = $('#theme').val();
        //修改主题
        if(theme != ""){
            if(theme == 2){
                $('body').addClass('skin-1');
            }else if(theme == 3){
                $('body').addClass('skin-3');
            }
        }
    })

    //修改主题
    function changeTheme(id){
        $.ajax({
            url:"<?php echo url('user/theme'); ?>",
            type:'post',
            dataType:'json',
            data:'id='+id,
            success:function(data){
                // if(data.code == 100){
                // wk.error(data.msg,2,'');
                // }
            }
        })
    }

    //退出登录
    $(document).ready(function(){
        $("#logout").click(function(){
            layer.confirm('你确定要退出吗？', {icon: 3,title:'提示'}, function(index){
                layer.close(index);
                window.location.href="<?php echo url('admin/login/loginOut'); ?>";
            });
        });
    });

    //清除缓存
    $(function(){
        $("#cache").click(function(){
            layer.confirm('你确定要清除缓存吗？', {icon: 3, title:'提示'}, function(index){
                $.getJSON("<?php echo url('admin/index/clear'); ?>",function(res){
                    if(res.code == 200){
                        wk.success(res.msg);
                    }else if(res.code == 100){
                        wk.error(res.msg);
                    }
                });
                layer.close(index);
            })
        });
    });


    //裁剪后的处理
    $("#sureCut").on("click",function () {
        if ($("#tailoringImg").attr("src") == null ){
            return false;
        }else{
            var cas = $('#tailoringImg').cropper('getCroppedCanvas');//获取被裁剪后的canvas
            var base64url = cas.toDataURL('image/png'); //转换为base64地址形式
            //关闭裁剪框
            layer.closeAll();
            $.ajax({
                url : "<?php echo url('Upload/updateFace'); ?>",
                type : "post",
                dataType : "json",
                data:"base64url="+base64url+"&id=<?php echo session('uid'); ?>",
                success : function(data) {
                    if(data.code == 200){
                        layer.msg(data.msg, {icon: 1,time:1500,shade: 0.1}, function(index){
                            window.location.reload();
                        });
                    }else if(data.code == 100){
                        wk.error(data.msg);
                        return false;
                    }
                }
            });
        }
    });

    /*添加标签*/
    // $.validator.setDefaults({
    //     highlight: function(e) {
    //         $(e).closest(".form-group").removeClass("has-success").addClass("has-error");
    //         $(e).closest(".form-control").css("color","#737373");
    //     },
    //     success: function(e) {
    //         // $(e).closest(".form-group").removeClass("has-error").addClass("has-success");
    //         $(e).closest(".form-group").removeClass("has-error");
    //     },
    //     errorElement: "span",
    //     errorPlacement: function(e, r) {
    //         e.appendTo(r.is(":radio") || r.is(":checkbox") ? r.parent().parent().parent() : r.parent())
    //         if(r.is("#add_tags")){
    //             e.appendTo(r.parent());
    //         }
    //     },
    //     errorClass: "help-block m-b-none",
    //     validClass: "help-block m-b-none"
    // }), $().ready(function() {
    //     var e = "<i class='fa fa-times-circle'></i> ";
    //     $("#add_tags").validate({
    //         rules: {
    //             tag_title:{
    //                 maxlength:10
    //             },
    //             tag_time: {
    //                 required: !0,
    //             },
    //             tag_content:{
    //                 required:!0,
    //                 maxlength:105
    //             }
    //
    //         },
    //         messages: {
    //             tag_title:{
    //                 maxlength: e + "最多可以输入10个字符",
    //             },
    //             tag_time: {
    //                 required: e + "请输入提醒日期",
    //             },
    //             tag_content: {
    //                 required: e + "请输入提醒内容",
    //                 maxlength: e + "最多可以输入105个字符"
    //             },
    //         },
    //         submitHandler: function(form) { //通过之后回调
    // //进行ajax传值
    //             $('button').attr('disabled','disabled');
    //             $.ajax({
    //                 url : "<?php echo url('Tool/addTags'); ?>",
    //                 type : "post",
    //                 dataType : "json",
    //                 data:$("#add_tags").serialize(),
    //                 success : function(data) {
    //                     if(data.code == 200){
    //                         $('#add_tags')[0].reset();
    //                         $("#myTags").modal('hide');
    //                         $('button').removeAttr('disabled');
    //                         wk.success(data.msg,1,'');
    //                     }else if(data.code == 100){
    //                         $('button').removeAttr('disabled');
    //                         wk.error(data.msg,2,'');
    //                         return false;
    //                     }else if(data.code == 0){
    //                         $('button').removeAttr('disabled');
    //                     }
    //                 }
    //             });
    //         }
    //     })
    // });


    /*修改密码*/
    layui.use(['form'], function() {
        var form = layui.form;
        form.verify({
            oldpwd:function(value,item){
                var checkResult = "";
                $.ajax({
                    url:"<?php echo url('User/editPwd'); ?>",
                    type:'post',
                    data:"old_pwd="+value +"&type=checkPassword",
                    async: false,//必须同步
                    success:function(res){
                        if(res.code == 100){
                            checkResult = "原密码错误";
                        }
                    }
                })
                return checkResult;
            },
            newpwd: [/^[\S]{6,12}$/,'密码必须6到12位，且不能出现空格'],
            rpwd:function(value,item){
                if(!/^[\S]{6,12}$/.test(value)){
                    return '密码必须6到12位，且不能出现空格';
                }
                var newpwd = $('input[name=new_pwd]').val();
                if(newpwd != value){
                    return "两次输入密码不一致";
                }
            }

        });
        form.on('submit(component-form-element)', function (data) {
            $('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
            $.ajax({
                url:"<?php echo url('User/editPwd'); ?>",
                type:'post',
                dataType:'json',
                data:data.field,
                success:function(res){
                    $(".layui-btn").removeClass('layui-disabled').removeAttr('disabled');
                    if (res.code == 200) {
                        wk.success(res.msg,1,"<?php echo url('admin/Login/loginOut'); ?>");
                    } else {
                        wk.error(res.msg);
                    }
                }
            })
        });
    });
</script>
</body>
</html>
